﻿#include "BaseStats.h"

BaseStats::BaseStats(MirClass job)
{
    Job = job;

    switch (job)
    {
        #pragma region Warrior
        case MirClass::Warrior:
            BaseStat *tempVar = new BaseStat(Stat::HP);
            tempVar->FormulaType = StatFormula::Health;
            tempVar->Base = 14;
            tempVar->Gain = 4.0F;
            tempVar->GainRate = 4.5F;
            tempVar->Max = 0;
            Stats.push_back(tempVar);
            BaseStat *tempVar2 = new BaseStat(Stat::MP);
            tempVar2->FormulaType = StatFormula::Mana;
            tempVar2->Base = 11;
            tempVar2->Gain = 3.5F;
            tempVar2->GainRate = 0.0F;
            tempVar2->Max = 0;
            Stats.push_back(tempVar2);
            BaseStat *tempVar3 = new BaseStat(Stat::BagWeight);
            tempVar3->FormulaType = StatFormula::Weight;
            tempVar3->Base = 50;
            tempVar3->Gain = 3.0F;
            tempVar3->GainRate = 0.0F;
            tempVar3->Max = 0;
            Stats.push_back(tempVar3);
            BaseStat *tempVar4 = new BaseStat(Stat::WearWeight);
            tempVar4->FormulaType = StatFormula::Weight;
            tempVar4->Base = 15;
            tempVar4->Gain = 20.0F;
            tempVar4->GainRate = 0.0F;
            tempVar4->Max = 0;
            Stats.push_back(tempVar4);
            BaseStat *tempVar5 = new BaseStat(Stat::HandWeight);
            tempVar5->FormulaType = StatFormula::Weight;
            tempVar5->Base = 12;
            tempVar5->Gain = 13.0F;
            tempVar5->GainRate = 0.0F;
            tempVar5->Max = 0;
            Stats.push_back(tempVar5);
            BaseStat *tempVar6 = new BaseStat(Stat::MinAC);
            tempVar6->FormulaType = StatFormula::Stat;
            tempVar6->Base = 0;
            tempVar6->Gain = 0;
            tempVar6->GainRate = 0.0F;
            tempVar6->Max = 0;
            Stats.push_back(tempVar6);
            BaseStat *tempVar7 = new BaseStat(Stat::MaxAC);
            tempVar7->FormulaType = StatFormula::Stat;
            tempVar7->Base = 0;
            tempVar7->Gain = 7;
            tempVar7->GainRate = 0.0F;
            tempVar7->Max = 0;
            Stats.push_back(tempVar7);
            BaseStat *tempVar8 = new BaseStat(Stat::MinDC);
            tempVar8->FormulaType = StatFormula::Stat;
            tempVar8->Base = 0;
            tempVar8->Gain = 5;
            tempVar8->GainRate = 0.0F;
            tempVar8->Max = 0;
            Stats.push_back(tempVar8);
            BaseStat *tempVar9 = new BaseStat(Stat::MaxDC);
            tempVar9->FormulaType = StatFormula::Stat;
            tempVar9->Base = 0;
            tempVar9->Gain = 5;
            tempVar9->GainRate = 0.0F;
            tempVar9->Max = 0;
            Stats.push_back(tempVar9);
            BaseStat *tempVar10 = new BaseStat(Stat::Agility);
            tempVar10->FormulaType = StatFormula::Stat;
            tempVar10->Base = 15;
            tempVar10->Gain = 0;
            tempVar10->GainRate = 0.0F;
            tempVar10->Max = 0;
            Stats.push_back(tempVar10);
            BaseStat *tempVar11 = new BaseStat(Stat::Accuracy);
            tempVar11->FormulaType = StatFormula::Stat;
            tempVar11->Base = 5;
            tempVar11->Gain = 0;
            tempVar11->GainRate = 0.0F;
            tempVar11->Max = 0;
            Stats.push_back(tempVar11);
            break;
        #pragma endregion
        #pragma region Wizard
        case MirClass::Wizard:
            BaseStat *tempVar12 = new BaseStat(Stat::HP);
            tempVar12->FormulaType = StatFormula::Health;
            tempVar12->Base = 14;
            tempVar12->Gain = 15.0F;
            tempVar12->GainRate = 1.8F;
            tempVar12->Max = 0;
            Stats.push_back(tempVar12);
            BaseStat *tempVar13 = new BaseStat(Stat::MP);
            tempVar13->FormulaType = StatFormula::Mana;
            tempVar13->Base = 13;
            tempVar13->Gain = 5.0F;
            tempVar13->GainRate = 0.0F;
            tempVar13->Max = 0;
            Stats.push_back(tempVar13);
            BaseStat *tempVar14 = new BaseStat(Stat::BagWeight);
            tempVar14->FormulaType = StatFormula::Weight;
            tempVar14->Base = 50;
            tempVar14->Gain = 5.0F;
            tempVar14->GainRate = 0.0F;
            tempVar14->Max = 0;
            Stats.push_back(tempVar14);
            BaseStat *tempVar15 = new BaseStat(Stat::WearWeight);
            tempVar15->FormulaType = StatFormula::Weight;
            tempVar15->Base = 15;
            tempVar15->Gain = 100.0F;
            tempVar15->GainRate = 0.0F;
            tempVar15->Max = 0;
            Stats.push_back(tempVar15);
            BaseStat *tempVar16 = new BaseStat(Stat::HandWeight);
            tempVar16->FormulaType = StatFormula::Weight;
            tempVar16->Base = 12;
            tempVar16->Gain = 90.0F;
            tempVar16->GainRate = 0.0F;
            tempVar16->Max = 0;
            Stats.push_back(tempVar16);
            BaseStat *tempVar17 = new BaseStat(Stat::MinDC);
            tempVar17->FormulaType = StatFormula::Stat;
            tempVar17->Base = 0;
            tempVar17->Gain = 7;
            tempVar17->GainRate = 0.0F;
            tempVar17->Max = 0;
            Stats.push_back(tempVar17);
            BaseStat *tempVar18 = new BaseStat(Stat::MaxDC);
            tempVar18->FormulaType = StatFormula::Stat;
            tempVar18->Base = 0;
            tempVar18->Gain = 7;
            tempVar18->GainRate = 0.0F;
            tempVar18->Max = 0;
            Stats.push_back(tempVar18);
            BaseStat *tempVar19 = new BaseStat(Stat::MinMC);
            tempVar19->FormulaType = StatFormula::Stat;
            tempVar19->Base = 0;
            tempVar19->Gain = 7;
            tempVar19->GainRate = 0.0F;
            tempVar19->Max = 0;
            Stats.push_back(tempVar19);
            BaseStat *tempVar20 = new BaseStat(Stat::MaxMC);
            tempVar20->FormulaType = StatFormula::Stat;
            tempVar20->Base = 0;
            tempVar20->Gain = 7;
            tempVar20->GainRate = 0.0F;
            tempVar20->Max = 0;
            Stats.push_back(tempVar20);
            BaseStat *tempVar21 = new BaseStat(Stat::Agility);
            tempVar21->FormulaType = StatFormula::Stat;
            tempVar21->Base = 15;
            tempVar21->Gain = 0;
            tempVar21->GainRate = 0.0F;
            tempVar21->Max = 0;
            Stats.push_back(tempVar21);
            BaseStat *tempVar22 = new BaseStat(Stat::Accuracy);
            tempVar22->FormulaType = StatFormula::Stat;
            tempVar22->Base = 5;
            tempVar22->Gain = 0;
            tempVar22->GainRate = 0.0F;
            tempVar22->Max = 0;
            Stats.push_back(tempVar22);
            break;
        #pragma endregion
        #pragma region Taoist
        case MirClass::Taoist:
            BaseStat *tempVar23 = new BaseStat(Stat::HP);
            tempVar23->FormulaType = StatFormula::Health;
            tempVar23->Base = 14;
            tempVar23->Gain = 6.0F;
            tempVar23->GainRate = 2.5F;
            tempVar23->Max = 0;
            Stats.push_back(tempVar23);
            BaseStat *tempVar24 = new BaseStat(Stat::MP);
            tempVar24->FormulaType = StatFormula::Mana;
            tempVar24->Base = 13;
            tempVar24->Gain = 8.0F;
            tempVar24->GainRate = 0.0F;
            tempVar24->Max = 0;
            Stats.push_back(tempVar24);
            BaseStat *tempVar25 = new BaseStat(Stat::BagWeight);
            tempVar25->FormulaType = StatFormula::Weight;
            tempVar25->Base = 50;
            tempVar25->Gain = 4.0F;
            tempVar25->GainRate = 0.0F;
            tempVar25->Max = 0;
            Stats.push_back(tempVar25);
            BaseStat *tempVar26 = new BaseStat(Stat::WearWeight);
            tempVar26->FormulaType = StatFormula::Weight;
            tempVar26->Base = 15;
            tempVar26->Gain = 50.0F;
            tempVar26->GainRate = 0.0F;
            tempVar26->Max = 0;
            Stats.push_back(tempVar26);
            BaseStat *tempVar27 = new BaseStat(Stat::HandWeight);
            tempVar27->FormulaType = StatFormula::Weight;
            tempVar27->Base = 12;
            tempVar27->Gain = 42.0F;
            tempVar27->GainRate = 0.0F;
            tempVar27->Max = 0;
            Stats.push_back(tempVar27);
            BaseStat *tempVar28 = new BaseStat(Stat::MinMAC);
            tempVar28->FormulaType = StatFormula::Stat;
            tempVar28->Base = 0;
            tempVar28->Gain = 12;
            tempVar28->GainRate = 0.0F;
            tempVar28->Max = 0;
            Stats.push_back(tempVar28);
            BaseStat *tempVar29 = new BaseStat(Stat::MaxMAC);
            tempVar29->FormulaType = StatFormula::Stat;
            tempVar29->Base = 0;
            tempVar29->Gain = 6;
            tempVar29->GainRate = 0.0F;
            tempVar29->Max = 0;
            Stats.push_back(tempVar29);
            BaseStat *tempVar30 = new BaseStat(Stat::MinDC);
            tempVar30->FormulaType = StatFormula::Stat;
            tempVar30->Base = 0;
            tempVar30->Gain = 7;
            tempVar30->GainRate = 0.0F;
            tempVar30->Max = 0;
            Stats.push_back(tempVar30);
            BaseStat *tempVar31 = new BaseStat(Stat::MaxDC);
            tempVar31->FormulaType = StatFormula::Stat;
            tempVar31->Base = 0;
            tempVar31->Gain = 7;
            tempVar31->GainRate = 0.0F;
            tempVar31->Max = 0;
            Stats.push_back(tempVar31);
            BaseStat *tempVar32 = new BaseStat(Stat::MinSC);
            tempVar32->FormulaType = StatFormula::Stat;
            tempVar32->Base = 0;
            tempVar32->Gain = 7;
            tempVar32->GainRate = 0.0F;
            tempVar32->Max = 0;
            Stats.push_back(tempVar32);
            BaseStat *tempVar33 = new BaseStat(Stat::MaxSC);
            tempVar33->FormulaType = StatFormula::Stat;
            tempVar33->Base = 0;
            tempVar33->Gain = 7;
            tempVar33->GainRate = 0.0F;
            tempVar33->Max = 0;
            Stats.push_back(tempVar33);
            BaseStat *tempVar34 = new BaseStat(Stat::Agility);
            tempVar34->FormulaType = StatFormula::Stat;
            tempVar34->Base = 18;
            tempVar34->Gain = 0;
            tempVar34->GainRate = 0.0F;
            tempVar34->Max = 0;
            Stats.push_back(tempVar34);
            BaseStat *tempVar35 = new BaseStat(Stat::Accuracy);
            tempVar35->FormulaType = StatFormula::Stat;
            tempVar35->Base = 5;
            tempVar35->Gain = 0;
            tempVar35->GainRate = 0.0F;
            tempVar35->Max = 0;
            Stats.push_back(tempVar35);
            break;
        #pragma endregion
        #pragma region Assassin
        case MirClass::Assassin:
            BaseStat *tempVar36 = new BaseStat(Stat::HP);
            tempVar36->FormulaType = StatFormula::Health;
            tempVar36->Base = 14;
            tempVar36->Gain = 4.0F;
            tempVar36->GainRate = 3.25F;
            tempVar36->Max = 0;
            Stats.push_back(tempVar36);
            BaseStat *tempVar37 = new BaseStat(Stat::MP);
            tempVar37->FormulaType = StatFormula::Mana;
            tempVar37->Base = 11;
            tempVar37->Gain = 5.0F;
            tempVar37->GainRate = 0.0F;
            tempVar37->Max = 0;
            Stats.push_back(tempVar37);
            BaseStat *tempVar38 = new BaseStat(Stat::BagWeight);
            tempVar38->FormulaType = StatFormula::Weight;
            tempVar38->Base = 50;
            tempVar38->Gain = 3.5F;
            tempVar38->GainRate = 0.0F;
            tempVar38->Max = 0;
            Stats.push_back(tempVar38);
            BaseStat *tempVar39 = new BaseStat(Stat::WearWeight);
            tempVar39->FormulaType = StatFormula::Weight;
            tempVar39->Base = 15;
            tempVar39->Gain = 33.0F;
            tempVar39->GainRate = 0.0F;
            tempVar39->Max = 0;
            Stats.push_back(tempVar39);
            BaseStat *tempVar40 = new BaseStat(Stat::HandWeight);
            tempVar40->FormulaType = StatFormula::Weight;
            tempVar40->Base = 12;
            tempVar40->Gain = 30.0F;
            tempVar40->GainRate = 0.0F;
            tempVar40->Max = 0;
            Stats.push_back(tempVar40);
            BaseStat *tempVar41 = new BaseStat(Stat::MinDC);
            tempVar41->FormulaType = StatFormula::Stat;
            tempVar41->Base = 0;
            tempVar41->Gain = 8;
            tempVar41->GainRate = 0.0F;
            tempVar41->Max = 0;
            Stats.push_back(tempVar41);
            BaseStat *tempVar42 = new BaseStat(Stat::MaxDC);
            tempVar42->FormulaType = StatFormula::Stat;
            tempVar42->Base = 0;
            tempVar42->Gain = 8;
            tempVar42->GainRate = 0.0F;
            tempVar42->Max = 0;
            Stats.push_back(tempVar42);
            BaseStat *tempVar43 = new BaseStat(Stat::Agility);
            tempVar43->FormulaType = StatFormula::Stat;
            tempVar43->Base = 20;
            tempVar43->Gain = 0;
            tempVar43->GainRate = 0.0F;
            tempVar43->Max = 0;
            Stats.push_back(tempVar43);
            BaseStat *tempVar44 = new BaseStat(Stat::Accuracy);
            tempVar44->FormulaType = StatFormula::Stat;
            tempVar44->Base = 5;
            tempVar44->Gain = 0;
            tempVar44->GainRate = 0.0F;
            tempVar44->Max = 0;
            Stats.push_back(tempVar44);
            break;
        #pragma endregion
        #pragma region Archer
        case MirClass::Archer:
            BaseStat *tempVar45 = new BaseStat(Stat::HP);
            tempVar45->FormulaType = StatFormula::Health;
            tempVar45->Base = 14;
            tempVar45->Gain = 4.0F;
            tempVar45->GainRate = 3.25F;
            tempVar45->Max = 0;
            Stats.push_back(tempVar45);
            BaseStat *tempVar46 = new BaseStat(Stat::MP);
            tempVar46->FormulaType = StatFormula::Mana;
            tempVar46->Base = 11;
            tempVar46->Gain = 4.0F;
            tempVar46->GainRate = 0.0F;
            tempVar46->Max = 0;
            Stats.push_back(tempVar46);
            BaseStat *tempVar47 = new BaseStat(Stat::BagWeight);
            tempVar47->FormulaType = StatFormula::Weight;
            tempVar47->Base = 50;
            tempVar47->Gain = 4.0F;
            tempVar47->GainRate = 0.0F;
            tempVar47->Max = 0;
            Stats.push_back(tempVar47);
            BaseStat *tempVar48 = new BaseStat(Stat::WearWeight);
            tempVar48->FormulaType = StatFormula::Weight;
            tempVar48->Base = 15;
            tempVar48->Gain = 33.0F;
            tempVar48->GainRate = 0.0F;
            tempVar48->Max = 0;
            Stats.push_back(tempVar48);
            BaseStat *tempVar49 = new BaseStat(Stat::HandWeight);
            tempVar49->FormulaType = StatFormula::Weight;
            tempVar49->Base = 12;
            tempVar49->Gain = 30.0F;
            tempVar49->GainRate = 0.0F;
            tempVar49->Max = 0;
            Stats.push_back(tempVar49);
            BaseStat *tempVar50 = new BaseStat(Stat::MinDC);
            tempVar50->FormulaType = StatFormula::Stat;
            tempVar50->Base = 0;
            tempVar50->Gain = 8;
            tempVar50->GainRate = 0.0F;
            tempVar50->Max = 0;
            Stats.push_back(tempVar50);
            BaseStat *tempVar51 = new BaseStat(Stat::MaxDC);
            tempVar51->FormulaType = StatFormula::Stat;
            tempVar51->Base = 0;
            tempVar51->Gain = 8;
            tempVar51->GainRate = 0.0F;
            tempVar51->Max = 0;
            Stats.push_back(tempVar51);
            BaseStat *tempVar52 = new BaseStat(Stat::MinMC);
            tempVar52->FormulaType = StatFormula::Stat;
            tempVar52->Base = 0;
            tempVar52->Gain = 8;
            tempVar52->GainRate = 0.0F;
            tempVar52->Max = 0;
            Stats.push_back(tempVar52);
            BaseStat *tempVar53 = new BaseStat(Stat::MaxMC);
            tempVar53->FormulaType = StatFormula::Stat;
            tempVar53->Base = 0;
            tempVar53->Gain = 8;
            tempVar53->GainRate = 0.0F;
            tempVar53->Max = 0;
            Stats.push_back(tempVar53);
            BaseStat *tempVar54 = new BaseStat(Stat::Agility);
            tempVar54->FormulaType = StatFormula::Stat;
            tempVar54->Base = 15;
            tempVar54->Gain = 0;
            tempVar54->GainRate = 0.0F;
            tempVar54->Max = 0;
            Stats.push_back(tempVar54);
            BaseStat *tempVar55 = new BaseStat(Stat::Accuracy);
            tempVar55->FormulaType = StatFormula::Stat;
            tempVar55->Base = 8;
            tempVar55->Gain = 0;
            tempVar55->GainRate = 0.0F;
            tempVar55->Max = 0;
            Stats.push_back(tempVar55);
            break;
            #pragma endregion

//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar55' statement was not added since tempVar55 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar54' statement was not added since tempVar54 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar53' statement was not added since tempVar53 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar52' statement was not added since tempVar52 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar51' statement was not added since tempVar51 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar50' statement was not added since tempVar50 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar49' statement was not added since tempVar49 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar48' statement was not added since tempVar48 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar47' statement was not added since tempVar47 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar46' statement was not added since tempVar46 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar45' statement was not added since tempVar45 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar44' statement was not added since tempVar44 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar43' statement was not added since tempVar43 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar42' statement was not added since tempVar42 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar41' statement was not added since tempVar41 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar40' statement was not added since tempVar40 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar39' statement was not added since tempVar39 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar38' statement was not added since tempVar38 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar37' statement was not added since tempVar37 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar36' statement was not added since tempVar36 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar35' statement was not added since tempVar35 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar34' statement was not added since tempVar34 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar33' statement was not added since tempVar33 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar32' statement was not added since tempVar32 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar31' statement was not added since tempVar31 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar30' statement was not added since tempVar30 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar29' statement was not added since tempVar29 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar28' statement was not added since tempVar28 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar27' statement was not added since tempVar27 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar26' statement was not added since tempVar26 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar25' statement was not added since tempVar25 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar24' statement was not added since tempVar24 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar23' statement was not added since tempVar23 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar22' statement was not added since tempVar22 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar21' statement was not added since tempVar21 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar20' statement was not added since tempVar20 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar19' statement was not added since tempVar19 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar18' statement was not added since tempVar18 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar17' statement was not added since tempVar17 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar16' statement was not added since tempVar16 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar15' statement was not added since tempVar15 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar14' statement was not added since tempVar14 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar13' statement was not added since tempVar13 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar12' statement was not added since tempVar12 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar11' statement was not added since tempVar11 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar10' statement was not added since tempVar10 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar9' statement was not added since tempVar9 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar8' statement was not added since tempVar8 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar7' statement was not added since tempVar7 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar6' statement was not added since tempVar6 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar5' statement was not added since tempVar5 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar4' statement was not added since tempVar4 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar3' statement was not added since tempVar3 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar2' statement was not added since tempVar2 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar' statement was not added since tempVar was passed to a method or constructor. Handle memory management manually.
    }

    Caps[Stat::MagicResist] = 2;
    Caps[Stat::PoisonResist] = 6;
    Caps[Stat::CriticalRate] = 18;
    Caps[Stat::CriticalDamage] = 10;
    Caps[Stat::Freezing] = 6;
    Caps[Stat::PoisonAttack] = 6;
    Caps[Stat::HealthRecovery] = 8;
    Caps[Stat::SpellRecovery] = 8;
    Caps[Stat::PoisonRecovery] = 6;
}

BaseStats::BaseStats(BinaryReader *reader)
{
    auto count = reader->ReadInt32();

    for (int i = 0; i < count; i++)
    {
        BaseStat *tempVar = new BaseStat(static_cast<Stat>(reader->ReadByte()));
        tempVar->FormulaType = static_cast<StatFormula>(reader->ReadByte());
        tempVar->Base = reader->ReadInt32();
        tempVar->Gain = reader->ReadSingle();
        tempVar->GainRate = reader->ReadSingle();
        tempVar->Max = reader->ReadInt32();
        Stats.push_back(tempVar);

//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar' statement was not added since tempVar was passed to a method or constructor. Handle memory management manually.
    }

    Caps = new Stats(reader);
}

void BaseStats::Save(BinaryWriter *writer)
{
    writer->Write(Stats.size());

    for (auto stat : Stats)
    {
        writer->Write(static_cast<unsigned char>(stat->Type));
        writer->Write(static_cast<unsigned char>(stat->FormulaType));
        writer->Write(stat->Base);
        writer->Write(stat->Gain);
        writer->Write(stat->GainRate);
        writer->Write(stat->Max);
    }

    Caps->Save(writer);
}

BaseStat::BaseStat(Stat type)
{
    Type = type;
}

int BaseStat::Calculate(MirClass job, int level)
{
    if (Gain == 0)
    {
        return Base;
    }

    if (FormulaType == StatFormula::Health)
    {
        int tempVar;
        switch (job)
        {
            case MirClass::Warrior:
                tempVar = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), Base + (level / Gain + GainRate + level / 20.0F) * level));
                break;
            default:
                tempVar = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), Base + (level / Gain + GainRate) * level));
                break;
        }
        return tempVar;
    }
    else if (FormulaType == StatFormula::Mana)
    {
        int tempVar2;
        switch (job)
        {
            case MirClass::Wizard:
                tempVar2 = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), Base + ((level / Gain + 2.0F) * 2.2F * level) + (level * GainRate)));
                break;
            case MirClass::Taoist:
                tempVar2 = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), (Base + level / Gain * 2.2F * level) + (level * GainRate)));
                break;
            default:
                tempVar2 = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), Base + (level * Gain) + (level * GainRate)));
                break;
        }
        return tempVar2;
    }
    else
    {
        int tempVar3;
        switch (FormulaType)
        {
            case StatFormula::Weight:
                tempVar3 = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), Base + ((level / Gain) * level)));
                break;
            default:
                tempVar3 = static_cast<int>(std::min(Max > 0 ? Max : std::numeric_limits<int>::max(), Base + (level / Gain)));
                break;
        }
        return tempVar3;
    }
}
